<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title>完善个人资料</title>
    <link rel="stylesheet" type="text/css" href="/static/css/animate.min.css"/>
    <link rel="stylesheet" type="text/css" href="/static/css/index.css"/>
    <link rel="stylesheet" type="text/css" href="/static/css/mui.min.css"/>
    <link rel="stylesheet" type="text/css" href="/static/css/public.css"/>
    <script src="/static/js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="/static/js/jquery.cookie.js" type="text/javascript" charset="utf-8"></script>
    <script src="/static/js/mui.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="/static/js/index.js" type="text/javascript" charset="utf-8"></script>
    <script src="/static/layer/mobile/layer.js" type="text/javascript" charset="utf-8"></script>
</head>
<body style="background: #fff;">
	<div class="header">
		<a href="/member_info/" class="backPage"></a>
		<p class="page_title">完善个人资料</p>
	</div>
	<div style="width: 100%; height: 0.88rem; background: none;"></div>
	<div class="inputBox">
		<div class="inputBox_form">
			<p>真实姓名</p>
			<input type="text" name="realname" value="{{ info.realname }}" placeholder="请输入真实姓名"/>
		</div>
		<div class="inputBox_form">
			<p>微信名</p>
			<input type="text" name="wx_name" value="{{ info.wx_name }}" placeholder="请输入微信名"/>
		</div>
		<div class="inputBox_form">
			<p>支付宝</p>
			<input type="text" name="zfb" value="{{ info.zfb }}" placeholder="请输入支付宝"/>
		</div>
		<div class="inputBox_form">
			<p>QQ</p>
			<input type="text" name="qq" value="{{ info.qq }}" placeholder="请输入QQ"/>
		</div>
	</div>
	<div class="login_btn">确认</div>
</body>
</html>
<script>
    $('.login_btn').click(function() {
        var realname=$("input[name='realname']").val();
        var wx_name=$("input[name='wx_name']").val();
        var zfb=$("input[name='zfb']").val();
        var qq=$("input[name='qq']").val();
        if(realname == ''){
            layer.open({
                content: '请输入真实姓名'
                ,skin: 'msg'
                ,time: 2 //2秒后自动关闭
            });
            
            return false;
        }
        $.ajax({
            type : "POST",
            url:"/member_edit/",//+tab,
            headers:{"X-CSRFToken":$.cookie('csrftoken')},
            data:{'realname':realname,'wx_name':wx_name,'zfb':zfb,'qq':qq}, 
            dataType:'json',		
            success: function(data){
               if(data.code == 1){
                    layer.open({
                        content: data.msg
                        ,skin: 'msg'
                        ,time: 3 //2秒后自动关闭
                    });
                    setTimeout(function(){
                        window.location.href="/member_info/"
                    },700);
                }else{
                    layer.open({
                        content: data.msg
                        ,skin: 'msg'
                        ,time: 2 //2秒后自动关闭
                    });
                }	
            }
        });
    });
</script>